//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.print.options;

import java.awt.*;
import javax.swing.*;

public class GroupAddressPanel extends JPanel {

    public GroupAddressPanel() {
        companyButton = null;
        statusButton = null;
        addrLn1Button = null;
        addrLn2Button = null;
        zipButton = null;
        cityButton = null;
        countryCheckBox = null;
        telCheckBox = null;
        optionCheckBox = null;
        initialize();
    }

    private void initialize() {
        FlowLayout flowLayout1 = new FlowLayout();
        setLayout(flowLayout1);
        setSize(300, 135);
        setBorder(BorderFactory.createTitledBorder(null, "Adresse", 0, 0, new Font("Dialog", 1, 12), new Color(51, 51, 51)));
        flowLayout1.setHgap(2);
        flowLayout1.setVgap(2);
        add(getCompanyButton(), null);
        add(getStatusButton(), null);
        add(getAddrLn1Button(), null);
        add(getAddrLn2Button(), null);
        add(getZipButton(), null);
        add(getCityButton(), null);
        add(getCountryCheckBox(), null);
        add(getTelCheckBox(), null);
        add(getOptionCheckBox(), null);
    }

    private JButton getCompanyButton() {
        if (companyButton == null) {
            companyButton = new JButton();
            companyButton.setPreferredSize(new Dimension(142, 20));
            companyButton.setText("Raison sociale");
            companyButton.setHorizontalAlignment(2);
            companyButton.setBorderPainted(false);
            companyButton.setContentAreaFilled(false);
            companyButton.setFocusPainted(false);
        }
        return companyButton;
    }

    private JButton getStatusButton() {
        if (statusButton == null) {
            statusButton = new JButton();
            statusButton.setPreferredSize(new Dimension(142, 20));
            statusButton.setText("Civilit\351");
            statusButton.setHorizontalAlignment(2);
            statusButton.setBorderPainted(false);
            statusButton.setContentAreaFilled(false);
            statusButton.setFocusPainted(false);
        }
        return statusButton;
    }

    private JButton getAddrLn1Button() {
        if (addrLn1Button == null) {
            addrLn1Button = new JButton();
            addrLn1Button.setPreferredSize(new Dimension(286, 20));
            addrLn1Button.setText("Adresse ligne 1");
            addrLn1Button.setHorizontalAlignment(2);
            addrLn1Button.setBorderPainted(false);
            addrLn1Button.setContentAreaFilled(false);
            addrLn1Button.setFocusPainted(false);
        }
        return addrLn1Button;
    }

    private JButton getAddrLn2Button() {
        if (addrLn2Button == null) {
            addrLn2Button = new JButton();
            addrLn2Button.setPreferredSize(new Dimension(286, 20));
            addrLn2Button.setHorizontalAlignment(2);
            addrLn2Button.setText("Adresse ligne 2");
            addrLn2Button.setBorderPainted(false);
            addrLn2Button.setContentAreaFilled(false);
            addrLn2Button.setFocusPainted(false);
        }
        return addrLn2Button;
    }

    private JButton getZipButton() {
        if (zipButton == null) {
            zipButton = new JButton();
            zipButton.setPreferredSize(new Dimension(120, 20));
            zipButton.setText("Code postal");
            zipButton.setHorizontalAlignment(2);
            zipButton.setBorderPainted(false);
            zipButton.setContentAreaFilled(false);
            zipButton.setFocusPainted(false);
        }
        return zipButton;
    }

    private JButton getCityButton() {
        if (cityButton == null) {
            cityButton = new JButton();
            cityButton.setPreferredSize(new Dimension(80, 20));
            cityButton.setHorizontalAlignment(2);
            cityButton.setText("Ville");
            cityButton.setBorderPainted(false);
            cityButton.setContentAreaFilled(false);
            cityButton.setFocusPainted(false);
        }
        return cityButton;
    }

    private JCheckBox getCountryCheckBox() {
        if (countryCheckBox == null) {
            countryCheckBox = new JCheckBox();
            countryCheckBox.setPreferredSize(new Dimension(84, 20));
            countryCheckBox.setText("Pays");
            countryCheckBox.setFocusPainted(false);
        }
        return countryCheckBox;
    }

    private JCheckBox getTelCheckBox() {
        if (telCheckBox == null) {
            telCheckBox = new JCheckBox();
            telCheckBox.setPreferredSize(new Dimension(142, 20));
            telCheckBox.setText("T\351l\351phone");
            telCheckBox.setFocusPainted(false);
        }
        return telCheckBox;
    }

    private JCheckBox getOptionCheckBox() {
        if (optionCheckBox == null) {
            optionCheckBox = new JCheckBox();
            optionCheckBox.setPreferredSize(new Dimension(142, 20));
            optionCheckBox.setText("Code");
            optionCheckBox.setFocusPainted(false);
        }
        return optionCheckBox;
    }

    public JButton getCompany() {
        return getCompanyButton();
    }

    public JButton getStatus() {
        return getStatusButton();
    }

    public JButton getAddrLn1() {
        return getAddrLn1Button();
    }

    public JButton getAddrLn2() {
        return getAddrLn2Button();
    }

    public JButton getZip() {
        return getZipButton();
    }

    public JButton getCity() {
        return getCityButton();
    }

    public JCheckBox getCountry() {
        return getCountryCheckBox();
    }

    public JCheckBox getTel() {
        return getTelCheckBox();
    }

    public JCheckBox getOption() {
        return getOptionCheckBox();
    }
    private JButton companyButton;
    private JButton statusButton;
    private JButton addrLn1Button;
    private JButton addrLn2Button;
    private JButton zipButton;
    private JButton cityButton;
    private JCheckBox countryCheckBox;
    private JCheckBox telCheckBox;
    private JCheckBox optionCheckBox;
}
